home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1995 November
/
EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso
/
earcd
/
misc
/
a8085.lha
/
A8085 V1.0
/
A8085.doc
< prev
next >
Wrap
Text File
|
1995-07-31
|
11KB
|
294 lines
___ ___ ___ ___ _____
/ _ \ / _ \ / _ \ / _ \| ____|
| |_| | (_) | | | | (_) | |__
| _ |> _ <| | | |> _ <|___ \
| | | | (_) | |_| | (_) |___) |
|_| |_|\___/ \___/ \___/|____/ V1.0
© 1994-95 by Frank Würkner
All Rights Reserved
COPYRIGHT NOTE
¯¯¯¯¯¯¯¯¯¯¯¯¯¯
The program A8085 is copyrighted © 1994-95 by Frank Würkner.
All rights reserved.
A8085 is FREEWARE. This program may be freely distributed as long as
- the executable and documentation remain unchanged and
are included in the distribution
- No other charge is made than to cover time and copying costs
DISCLAIMER
¯¯¯¯¯¯¯¯¯¯
No warranties of any kind are made as to the functionality of this
program. You are using it ENTIRE at your own risk.
SYSTEM REQUIREMENTS
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
You'll need OS2.0 or higher !!!
WHAT IS IT
¯¯¯¯¯¯¯¯¯¯
Why emulate a 8bit 8085 CPU you may ask ???
The 8085 is often used to teach beginners the basics about processors. But
often you are forced to use antique computer equipment where you have to
enter the code as hex numbers. Or even worst you are only thought in an
abstract way without ever seeing how or if the programs you write work.
That's where A8085 comes in. But you can also learn some basic things
about computers (stack, internal processor flags, ...). And the best:
The computer doesn't guru if your program is wrong!
FEATURES
¯¯¯¯¯¯¯¯
+ emulator/assembler/disassembler support all 246 instructions of the 8085,
even those 10 illegal commands :-)
+ execute single instructions by simply typing them in the command line
+ emulator counts the cycles the real 8085 would have needed
+ any number of breakpoints
+ import/export data from/to the 8085 memory
+ powerfull expression calculator
+ often used command sequences can be put into macro files
+ comes with a mini kernal including most needed functions (divide, multiply,
print, print number, ...)
- interrupts and serial I/O are not part of the emulation
- all I/O commands (i.e. OUT and IN) are only mapped to the terminal window
- the emulation is quite slow, assembling is even slower
USAGE
¯¯¯¯¯
A8085 can be started in the CLI or via the supplied startup icon.
When started via CLI you can supply one macrofile, that should be executed
at startup.
The program uses following directory structure that can not be changed. all
those drawers must be present in the current directory:
drawer | extension | description
-------+-----------+--------------------------------------------------
SRC/ | .a | assembler source files
INC/ | .i | includefiles (currently only Kernal.i)
PRG/ | .p | program files created by assembling source files
MAC/ | .m | macrofiles
At startup A8085 reads the file PRG/Kernal.p into memory which is the
current kernal.
A8085 understands the following commands:
o ASSEMBLE (short AS) file.a[,v,w]
The 8085 mnonics in the SRC/file are assembled into memory. If you use the
`,v' switch the assembled commands are also printed to the window. If you
use `,w' switch the code is also written to the PRG/file.p. The programm
file also includes the state of all registers (including PC which is set to
the label `start', or to the begin of your program if not present).
All commands described in 8085.doc are understood. You can define lables
by putting a `<labelname>:' at the beginning of the line. Each line can only
contain one command! There are also some pseudo commands that are helpfull:
o ILL <$10,$08,$18,$28,$38,$CB,$D9,$DD,$ED,$FD>
These are the 10 bytes of the 8085 that do not represent a 8085 command.
While you may see them when disassembling text or data, you shouldn't
need them for assembling because the next to pseudo commands are much
easier to use.
o DC.B [bytes],["text"]
Assemble data bytes and/or text into programm.
Example `DC.B "this is text!",0,"even more",0'
o DC.W [words]
Assemble words into programm (one word is made of two bytes).
Example `DC.W $ffff,15478,0,%1110010001111110'
o ORG address
Define memory address where following code should be put to.
o EQU label = number
Define a label with any number/address.
o INC file.i
Include the file INC/file.i into the program. The commands there will be
interpreted as if they stood in the program text itself.
Example: To use the kernal functions `inc Kernal.i'
o DISASSEMBLE (short DIS) start[,end]
Disassemble memory from start (to end). You can stop the output with CTRL-C.
o MEMORY (short M) start[,end]
Show content of memory from start (to end). You can stop the output with
CTRL-C.
o GO [address]
Start emulating a 8085 at address (if ommitted start where the program
counter points to). The emulation can be stopped by pressing CTRL-C.
Otherwise it will stop at HLT commands as well as illegal commands.
If you have set breakpoints, it will also stop there! At the end it will
show you the state of all internal registers and processor flags (see
STATUS command).
o STATUS (short ST)
Show state of internal registers (in hexadecimal numbers) and processor
flags, e.g
program stack accumulator parity flag
counter pointer | / zero flag
| | | | |
PC: 1023 SP: 1000 A : 49 C-P-A-Z-S <- sign flag
BC: 0000 DE: 0000 HL: 1000 1 1 0 1 0
| | | | |
| DE register | \ auxiliary carry flag
| pair HL register \
BC register pair carry flag
pair
[emulated 1851 cycles]
|
processor cycles that a real
8085 would have needed
o LOAD (short LD) file.p
Load the program PRG/file.p into memory and set all internal registers.
o RUN file.p
Load PRG/file.p (see above) and start emulation.
o IMPORT (short I) file,start[,len]
Import data to 8085 memory form file to memory address start (len bytes
long).
o EXPORT (short E) file,start[,len]
Export data from 8085 memory form memory address start to file (len bytes
long).
o CALC (short C) expression
Calculate expression and show result as real, decimal, hexadecimal
and binary.
Examples:
`sin(pi)-cos(rad(90)-pi)' -> 6.97573699601729E-16 [8bit: 0 $00 %00000000]
`5!-1*2*3*4*5' -> 1.13686837721616E-13 [8bit: 0 $00 %00000000]
`(7=8) xor true' -> -1 [16bit: 65535 $FFFF %1111111111111111]
`1000 mod 7' -> 6 [8bit: 6 $06 %00000110]
`(&377+$ff+%11111111)/3' -> 255 [8bit: 255 $FF %11111111]
o SETBREAKPOINT (short BP) [address]
Set a breakpoint at address. If address is omitted: show all current
breakpoints.
o CLEARBREAKPOINT (short CBP) nr
Clear breakpoint with number nr (use BP to find number!).
o ECHO string
Print string to window (for macros).
o WAIT
Wait for <RETURN> to be pushed (for macros).
o macroname
Executes the commands in MAC/macroname.m.
Currently only the macro `ed' is available. You can comfortable edit the
8085 memory (you need to have aminet/disk/moni/Zap247.lha installed in
your c: directory).
o register(pair)=expression
Set the a register or registerpair to a value, e.g. `PC=$1000'.
Shows STATUS afterwards.
o 8085-mnemo ?|args
This is one of the most powerfull possibilties!
Show arguments to a 8085 menmonic, e.g. `PUSH ?' will give
'PUSH <BC,DE,HL>
PUSH PSW'
Even better: Execute 8085 command by simply entering the 8085 menmonic
plus arguments and immediate see what effect it has to the internal
registers and flags, e.g. `PUSH BC' (have a look at the stack pointer and
where it points to!)
o !CLI-command
Execute the CLI command.
o QUIT (short Q)
Quit A8085.
o HELP (short H)
Display a short help page
EXAMPLE SESSION
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
double click `Start A8085'
take a look at SRC/BubbleSort.a
> as BubbleSort.a [assemble BubbleSort into memory]
*** Pass 1
*** Pass 2
code from $1000 to $103E (start at $101E)
> dis start,$103E [let's have a look at the code]
101E: 21 00 10 LXI HL,$1000
1021: 06 1D MVI B,$1D
1023: 0E 00 MVI C,$00
1025: 56 MOV D,M
1026: 23 INX HL
1027: 7E MOV A,M
1028: BA CMP D
1029: D2 33 10 JNC $1033
102C: 0E 01 MVI C,$01
102E: 2B DCX HL
102F: 77 MOV M,A
1030: 23 INX HL
1031: 72 MOV M,D
1032: 7A MOV A,D
1033: 57 MOV D,A
1034: 05 DCR B
1035: C2 26 10 JNZ $1026
1038: 79 MOV A,C
1039: FE 01 CPI $01
103B: CA 1E 10 JZ $101E
103E: 76 HLT
> m btab,etab [now at the table we want to sort]
1000: 0D 03 07 0C 02 09 01 0A 04 2D 17 0C 36 38 C6 `·········-··68Æ'
100F: 2B C8 22 0B 6F 16 36 7A D3 F5 FF 2C FA A6 05 `+È"·o·6zÓõÿ,ú¦·'
> bp $103B [let's have a breakpoint at the
> bp first round!]
Breakpoint #1 : $103B
> go [start emulation]
*** Breakpoint at $103B
PC: 103B SP: 1000 A : 01 C-P-A-Z-S
BC: 0001 DE: FF00 HL: 101D 0 1 0 1 0
[emulated 2058 cycles]
> m btab,etab [do you see our bubbles go up?]
1000: 03 07 0C 02 09 01 0A 04 0D 17 0C 2D 36 38 2B `···········-68+'
100F: C6 22 0B 6F 16 36 7A C8 D3 F5 2C FA A6 05 FF `Æ"·o·6zÈÓõ,ú¦·ÿ'
> cbp 1 [now clear our breakpoint]
> go [and resume emulation]
*** HLT command
PC: 103E SP: 1000 A : 00 C-P-A-Z-S
BC: 0000 DE: FF00 HL: 101D 1 1 1 0 1
[emulated 36786 cycles]
> m btab,etab [have a look at our sorted table]
1000: 01 02 03 04 05 07 09 0A 0B 0C 0C 0D 16 17 22 `··············"'
100F: 2B 2C 2D 36 36 38 6F 7A A6 C6 C8 D3 F5 FA FF `+,-668oz¦ÆÈÓõúÿ'
> q [that's it folks!]
If you have comments, suggestions, criticism, bug reports etc.
send mail to
Frank Würkner
Georgenschwaigstr. 22
D-80807 München
Germany
or
E-Mail: wuerkner@informatik.tu-muenchen.de